package com.bc.web.service;


import java.util.List;

import com.bc.web.model.Account;
import com.bc.web.model.Channel;
import com.fs.common.util.FSDate;
import com.fs.common.util.FSIDGenerate;

public class AccountService {
	
	public void addAccount(String merchCode,String name) {
		List<Channel> channelList = Channel.dao.selectAll();
		for (Channel channel : channelList) {
			Account ac = new Account();
			ac.setId(FSIDGenerate.getUUID());
			ac.setChannelNo(channel.getCode());
			ac.setAccountNo(merchCode);
			ac.setAccountName(name);
			ac.setBalance(0L);
			ac.setD0Balance(0L);
			ac.setEnable(true);
			ac.setCreateDateTime(FSDate.getDateTime());
			ac.save();
		}
	}

}
